package com.sylar.happygps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MapOptions extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.mapoptions);
		
		Button btn_title_left = (Button) findViewById(R.id.btn_title_left);
		btn_title_left.setText("地图");
		btn_title_left.setVisibility(View.VISIBLE);
		btn_title_left.setOnClickListener(this);
		
		TextView tv_title_name = (TextView) findViewById(R.id.tv_title_name);
		tv_title_name.setText("选择操作");
		
		Button btn_help = (Button) findViewById(R.id.btn_help);
		btn_help.setVisibility(View.VISIBLE);
		btn_help.setOnClickListener(this);
		
		
		View btn_show_history_path = findViewById(R.id.btn_show_history_path);
		View btn_search_map = findViewById(R.id.btn_search_map);
		View btn_close_map_bg = findViewById(R.id.btn_close_map_bg);
		View btn_to_map_auto = findViewById(R.id.btn_to_map_auto);
		View btn_not_map_auto = findViewById(R.id.btn_not_map_auto);
		
		btn_show_history_path.setOnClickListener(this);
		btn_search_map.setOnClickListener(this);
		btn_close_map_bg.setOnClickListener(this);
		btn_to_map_auto.setOnClickListener(this);
		btn_not_map_auto.setOnClickListener(this);
		
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_title_left:
			finish();
			break;
		case R.id.btn_help:
			toHelpActivity();
			break;
		case R.id.btn_show_history_path:
			finish();
			break;
		case R.id.btn_search_map:
			toSearchMap();
			break;
		case R.id.btn_close_map_bg:
			finish();
			break;
		case R.id.btn_to_map_auto:
			finish();
			break;
		case R.id.btn_not_map_auto:
			finish();
			break;
		}
	}
	
	//搜索地图
	private void toSearchMap(){
		Intent intent = new Intent(this,SearchMap.class);
		startActivity(intent);
		finish();
	}
	private void toHelpActivity(){
		Intent intent = new Intent(this,HelpActivity.class);
		intent.putExtra("helptype", HelpActivity.TYPE_MAP_OPTION_HELP);
		startActivity(intent);
	}
}
